#include "Blocks/PhotodiodeBlock.h"

namespace PocketSurvival
{
    int32_t PhotodiodeBlock::getIndex()
    {
        return Index();
    }
    const std::string &PhotodiodeBlock::getBlockName()
    {
        static std::string blockName = "PhotodiodeBlock";
        return blockName;
    }

    int32_t PhotodiodeBlock::getFace(int32_t value)
    {
        return Terrain::ExtractData(value) & 7;
    }
    
    const std::vector<BoundingBox> &PhotodiodeBlock::getCustomCollisionBoxes(int32_t value)
    {
        int32_t num = Terrain::ExtractData(value);
        if(num < GET_ARRAY_LEN(BlockConstans::photodiodeCollisionBoxes))
        {
            return BlockConstans::photodiodeCollisionBoxes[num];
        }
        return BlockConstans::zeroCollisionBoxes;
    }
}